package com.cole.gx095.Repository;

import com.cole.gx095.entity.PurBillgoods;
import com.cole.gx095.entity.SaleBillgoods;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SaleBillgoodsRepository extends JpaRepository<SaleBillgoods,Integer>, JpaSpecificationExecutor<SaleBillgoods> {

    @Query(value = "select * from salebillgoods bg where bg.contractNum = ?1", nativeQuery = true)
    List<SaleBillgoods> findAllBycontractNum(String contractNum);

    @Query(value = "select * from salebillgoods bg where bg.billId = ?1", nativeQuery = true)
    List<SaleBillgoods> findByBillId(Integer id);
}
